//Wed 23 Dec 2009 12:15:59 AM CST 
//Thu 21 Jan 2010 05:43:53 PM CST Modified;
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>

using namespace std;

class AppleWord
{
public:
	int minRep(string word)
	{
		int ret = 0;
		if(word.size() < 5) return -1;
		int N = word.size();
		string cmp(N-3, 'p');
		cmp = "A" + cmp + "le";
		for(int i=0; i<N; i++)
		{
			if(tolower(cmp[i]) != tolower(word[i]))
				ret++;
		}
		return ret;
	}
};
